package com.ourgame.tankgame.bullet;

import com.ourgame.tankgame.attribute.BulletAttribute;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.scene.Spatial;
import gameutil.Role;

/**
 *
 * @author L
 */
public class NormalBullet extends Bullet {

    public NormalBullet(Spatial spatial, Role bulletRole) {
        super(spatial, bulletRole);
    }

    public NormalBullet(BulletAttribute bulletInfo, Spatial spatial) {
        super(bulletInfo, spatial);
    }

    public NormalBullet(Spatial spatial) {
        this(spatial, null);
    }

    @Override
    public void setBulletDir(Vector3f vec) {
        bulletControl.setLinearVelocity(vec.mult(getBulletAttribute().getBulletSpeed()));
    }

    @Override
    public void setBulletRot(Quaternion rot) {
        bulletControl.setPhysicsRotation(rot);
    }

    @Override
    public void setBulletPos(Vector3f vec) {
        bulletControl.setPhysicsLocation(vec);
    }
}
